<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: esp8266/hspi.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_cc2d49507704e901eabd8a82be491fc5.html">esp8266</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">hspi.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>HSPI driver for ESP8255 Based on initial work from Sem 2015 - rewrittem Added code to handle proper aligned reads and writes and buffering.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="user__config_8h_source.html">user_config.h</a>&quot;</code><br />
<code>#include &lt;stdint.h&gt;</code><br />
<code>#include &lt;stdarg.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &quot;<a class="el" href="hspi_8h_source.html">hspi.h</a>&quot;</code><br />
<code>#include &quot;gpio.h&quot;</code><br />
</div>
<p><a href="hspi_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ac0b594f74d77f8ac1ee56fd39fcfecdc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#ac0b594f74d77f8ac1ee56fd39fcfecdc">HSPI_PRESCALER</a>&#160;&#160;&#160;16</td></tr>
<tr class="separator:ac0b594f74d77f8ac1ee56fd39fcfecdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a75c90f17c5ded9cd0515d597533ac517"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a75c90f17c5ded9cd0515d597533ac517">hspi_init</a> (<a class="el" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> prescale, int hwcs)</td></tr>
<tr class="memdesc:a75c90f17c5ded9cd0515d597533ac517"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI Initiaization - with automatic chip select Pins: MISO GPIO12 MOSI GPIO13 CLK GPIO14 CS GPIO15 - optional DC GPIO2.  <a href="#a75c90f17c5ded9cd0515d597533ac517">More...</a><br /></td></tr>
<tr class="separator:a75c90f17c5ded9cd0515d597533ac517"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34e8f95d18d9550c20576b48803d6785"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">hspi_config</a> (int configState)</td></tr>
<tr class="memdesc:a34e8f95d18d9550c20576b48803d6785"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI Configuration for tranasmit and receive.  <a href="#a34e8f95d18d9550c20576b48803d6785">More...</a><br /></td></tr>
<tr class="separator:a34e8f95d18d9550c20576b48803d6785"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa699c6593cc1ccd0e1b972bab7b527d9"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#aa699c6593cc1ccd0e1b972bab7b527d9">hspi_setBits</a> (<a class="el" href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> bytes)</td></tr>
<tr class="memdesc:aa699c6593cc1ccd0e1b972bab7b527d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI FIFO send or receive byte count.  <a href="#aa699c6593cc1ccd0e1b972bab7b527d9">More...</a><br /></td></tr>
<tr class="separator:aa699c6593cc1ccd0e1b972bab7b527d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16038c164ad4e103feeddafe6bdce825"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">hspi_startSend</a> (void)</td></tr>
<tr class="memdesc:a16038c164ad4e103feeddafe6bdce825"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI Start Send.  <a href="#a16038c164ad4e103feeddafe6bdce825">More...</a><br /></td></tr>
<tr class="separator:a16038c164ad4e103feeddafe6bdce825"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1a0f7a7dd3cac5dd6b8489f7ff308dc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a> (void)</td></tr>
<tr class="memdesc:af1a0f7a7dd3cac5dd6b8489f7ff308dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI Ready wait.  <a href="#af1a0f7a7dd3cac5dd6b8489f7ff308dc">More...</a><br /></td></tr>
<tr class="separator:af1a0f7a7dd3cac5dd6b8489f7ff308dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc6137e3acc101f92a9502ad207f0b4d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">hspi_writeFIFO</a> (<a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *write_data, int bytes)</td></tr>
<tr class="memdesc:afc6137e3acc101f92a9502ad207f0b4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI FIFO write in units of 32 bits (4 byte words)  <a href="#afc6137e3acc101f92a9502ad207f0b4d">More...</a><br /></td></tr>
<tr class="separator:afc6137e3acc101f92a9502ad207f0b4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50884c24ab0b495b0c0112547ecde051"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a50884c24ab0b495b0c0112547ecde051">hspi_readFIFO</a> (<a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *read_data, int bytes)</td></tr>
<tr class="memdesc:a50884c24ab0b495b0c0112547ecde051"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI FIFO Read in units of 32 bits (4 byte words)  <a href="#a50884c24ab0b495b0c0112547ecde051">More...</a><br /></td></tr>
<tr class="separator:a50884c24ab0b495b0c0112547ecde051"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95e93b2eb7fb8bd8548f2ad9022aac58"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a95e93b2eb7fb8bd8548f2ad9022aac58">hspi_TX</a> (<a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, int count)</td></tr>
<tr class="memdesc:a95e93b2eb7fb8bd8548f2ad9022aac58"><td class="mdescLeft">&#160;</td><td class="mdescRight">SPI buffered write functions.  <a href="#a95e93b2eb7fb8bd8548f2ad9022aac58">More...</a><br /></td></tr>
<tr class="separator:a95e93b2eb7fb8bd8548f2ad9022aac58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ea1bd90994ac123b4c62bfa511b6972"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a1ea1bd90994ac123b4c62bfa511b6972">hspi_TXRX</a> (<a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, int count)</td></tr>
<tr class="memdesc:a1ea1bd90994ac123b4c62bfa511b6972"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI write and read using FIFO.  <a href="#a1ea1bd90994ac123b4c62bfa511b6972">More...</a><br /></td></tr>
<tr class="separator:a1ea1bd90994ac123b4c62bfa511b6972"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0603c3e5a8c6c29e5deb5609b28e86bc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a0603c3e5a8c6c29e5deb5609b28e86bc">hspi_RX</a> (<a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, int count)</td></tr>
<tr class="memdesc:a0603c3e5a8c6c29e5deb5609b28e86bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">HSPI read using FIFO.  <a href="#a0603c3e5a8c6c29e5deb5609b28e86bc">More...</a><br /></td></tr>
<tr class="separator:a0603c3e5a8c6c29e5deb5609b28e86bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a9d8a27ff6d91c4aa89e8719b960d7404"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a9d8a27ff6d91c4aa89e8719b960d7404">_hspi_init_done</a> = 0</td></tr>
<tr class="separator:a9d8a27ff6d91c4aa89e8719b960d7404"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13f392bc0f33d99955c2d8ef84f0c583"><td class="memItemLeft" align="right" valign="top"><a class="el" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hspi_8c.html#a13f392bc0f33d99955c2d8ef84f0c583">hspi_clock</a> = -1</td></tr>
<tr class="memdesc:a13f392bc0f33d99955c2d8ef84f0c583"><td class="mdescLeft">&#160;</td><td class="mdescRight">hspi clock cached value  <a href="#a13f392bc0f33d99955c2d8ef84f0c583">More...</a><br /></td></tr>
<tr class="separator:a13f392bc0f33d99955c2d8ef84f0c583"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>HSPI driver for ESP8255 Based on initial work from Sem 2015 - rewrittem Added code to handle proper aligned reads and writes and buffering. </p>
<dl class="section user"><dt>Copyright &copy; 2015 Sem</dt><dd></dd></dl>
<dl class="section user"><dt>Copyright &copy; 2015 Mike Gore, GPL License</dt><dd></dd></dl>
<dl class="section user"><dt>You are free to use this code under the terms of GPL</dt><dd>Please retain a copy of this notice in any code you use it in.</dd></dl>
<p>This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>. </p>

<p>Definition in file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ac0b594f74d77f8ac1ee56fd39fcfecdc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HSPI_PRESCALER&#160;&#160;&#160;16</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00037">37</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a34e8f95d18d9550c20576b48803d6785"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void hspi_config </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>configState</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>HSPI Configuration for tranasmit and receive. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">configState</td><td>CONFIG_FOR_RX_TX or CONFIG_FOR_RX </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00104">104</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00318">hspi_RX()</a>, <a class="el" href="hspi_8c_source.html#l00265">hspi_TX()</a>, and <a class="el" href="hspi_8c_source.html#l00292">hspi_TXRX()</a>.</p>

</div>
</div>
<a class="anchor" id="a75c90f17c5ded9cd0515d597533ac517"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hspi_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
          <td class="paramname"><em>prescale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>hwcs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HSPI Initiaization - with automatic chip select Pins: MISO GPIO12 MOSI GPIO13 CLK GPIO14 CS GPIO15 - optional DC GPIO2. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">prescale</td><td>prescale from CPU clock 0 .. 0x1fff </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">hwcs</td><td>enable GPIO15 hardware chip select </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00055">55</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="user__main_8c_source.html#l00971">setup()</a>, and <a class="el" href="hal_8c_source.html#l00327">spi_init()</a>.</p>

</div>
</div>
<a class="anchor" id="a50884c24ab0b495b0c0112547ecde051"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void hspi_readFIFO </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>read_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>HSPI FIFO Read in units of 32 bits (4 byte words) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">read_data</td><td>read buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bytes</td><td>bytes to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00215">215</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00318">hspi_RX()</a>, and <a class="el" href="hspi_8c_source.html#l00292">hspi_TXRX()</a>.</p>

</div>
</div>
<a class="anchor" id="a0603c3e5a8c6c29e5deb5609b28e86bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hspi_RX </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HSPI read using FIFO. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*data</td><td>receive buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>number of bytes to read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00318">318</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hal_8c_source.html#l00454">spi_RX()</a>, and <a class="el" href="hal_8c_source.html#l00428">spi_RX_buffer()</a>.</p>

</div>
</div>
<a class="anchor" id="aa699c6593cc1ccd0e1b972bab7b527d9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void hspi_setBits </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a>&#160;</td>
          <td class="paramname"><em>bytes</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>HSPI FIFO send or receive byte count. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">bytes</td><td>bytes to send or receive </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00140">140</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00215">hspi_readFIFO()</a>, and <a class="el" href="hspi_8c_source.html#l00169">hspi_writeFIFO()</a>.</p>

</div>
</div>
<a class="anchor" id="a16038c164ad4e103feeddafe6bdce825"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void hspi_startSend </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>HSPI Start Send. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00151">151</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00318">hspi_RX()</a>, <a class="el" href="hspi_8c_source.html#l00265">hspi_TX()</a>, and <a class="el" href="hspi_8c_source.html#l00292">hspi_TXRX()</a>.</p>

</div>
</div>
<a class="anchor" id="a95e93b2eb7fb8bd8548f2ad9022aac58"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hspi_TX </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>SPI buffered write functions. </p>
<p>=================================================================HSPI write using FIFO </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*data</td><td>transmit buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>number of bytes to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00265">265</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hal_8c_source.html#l00469">spi_TX()</a>, and <a class="el" href="hal_8c_source.html#l00414">spi_TX_buffer()</a>.</p>

</div>
</div>
<a class="anchor" id="a1ea1bd90994ac123b4c62bfa511b6972"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hspi_TXRX </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HSPI write and read using FIFO. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*data</td><td>transmit / receive buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>number of bytes to write / read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00292">292</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hal_8c_source.html#l00483">spi_TXRX()</a>, and <a class="el" href="hal_8c_source.html#l00442">spi_TXRX_buffer()</a>.</p>

</div>
</div>
<a class="anchor" id="af1a0f7a7dd3cac5dd6b8489f7ff308dc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hspi_waitReady </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HSPI Ready wait. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00159">159</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="user__task_8c_source.html#l00067">esp_yield()</a>, <a class="el" href="hspi_8c_source.html#l00104">hspi_config()</a>, <a class="el" href="hspi_8c_source.html#l00055">hspi_init()</a>, <a class="el" href="hspi_8c_source.html#l00318">hspi_RX()</a>, <a class="el" href="hspi_8c_source.html#l00265">hspi_TX()</a>, <a class="el" href="hspi_8c_source.html#l00292">hspi_TXRX()</a>, <a class="el" href="user__task_8c_source.html#l00113">loop_wrapper()</a>, and <a class="el" href="hal_8c_source.html#l00306">spi_waitReady()</a>.</p>

</div>
</div>
<a class="anchor" id="afc6137e3acc101f92a9502ad207f0b4d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void hspi_writeFIFO </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>write_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>HSPI FIFO write in units of 32 bits (4 byte words) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">write_data</td><td>write buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bytes</td><td>bytes to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00169">169</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00318">hspi_RX()</a>, <a class="el" href="hspi_8c_source.html#l00265">hspi_TX()</a>, and <a class="el" href="hspi_8c_source.html#l00292">hspi_TXRX()</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a9d8a27ff6d91c4aa89e8719b960d7404"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">_hspi_init_done = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00041">41</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00055">hspi_init()</a>.</p>

</div>
</div>
<a class="anchor" id="a13f392bc0f33d99955c2d8ef84f0c583"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> hspi_clock = -1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>hspi clock cached value </p>

<p>Definition at line <a class="el" href="hspi_8c_source.html#l00044">44</a> of file <a class="el" href="hspi_8c_source.html">hspi.c</a>.</p>

<p>Referenced by <a class="el" href="hspi_8c_source.html#l00055">hspi_init()</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
